package javacafe.action.vote;

import javacafe.action.Action;
import javacafe.action.ActionForward;
import javacafe.dto.member.LoginInfoDTO;
import javacafe.dto.vote.VoteDTO;
import javacafe.serviceimple.VoteServiceImple;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class VoteUpdateFormAction implements Action {

	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		
		ActionForward actfoward = new ActionForward();	
		VoteServiceImple service = VoteServiceImple.getInstance();		
		VoteDTO dto = new VoteDTO();
		
		String vote_no = request.getParameter("seq");
		dto.setVote_no(Integer.parseInt(vote_no));		
		
		dto = service.getVote(dto);
				
		request.setAttribute("dto",dto);
		actfoward.setUrl("updatevoteform");
		return actfoward;
	}

}
